//
// Created by Administrator on 2023/11/17.
//

// bfs and dfs都可以做 bfs代码实现更简单，就是在入队时判断一下入度
#include "iostream"
#include "cstring"

using namespace std;
const int N = 1e5 + 10;
int n, m;
int d[N];//表示入度的数组
int q[N];
int e[N], ne[N], h[N], idx;

void add(int a, int b) {
    e[idx] = b;
    ne[idx] = h[a];
    h[a] = idx++;
}
//bfs实现
void topsort() {
    int hh = 0, tt = -1;
    //入度为0的全部入队
    for (int i = 1; i <= n; ++i) {
        if (!d[i]) q[++tt] = i;
    }
    //队列不为空
    while (hh <= tt) {
        int t = q[hh++];//逻辑出队
        for (int i = h[t]; i != -1; i = ne[i]) {
            int j = e[i];
            d[j]--;
            if (d[j] == 0)q[++tt] = j;
        }
    }
    //所有元素都进过一次队列，表示已经遍历完图
    if(tt==n-1){
        for (int i = 0; i <= tt; ++i) {
            cout<<q[i]<<' ';
        }
    }
    else
        cout<<-1;
}

int main() {
    cin >> n >> m;
    int a, b;

    memset(h, -1, sizeof h);

    while (m--) {
        cin >> a >> b;
        add(a, b);
        d[b]++;
    }
    topsort();
}